package com.wen.design.service.impl;

import com.wen.design.service.PayService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;

@Slf4j
@Service
public class WxPayServiceImpl implements  PayService
//        , WxPayService
{

    @Override
    public Map<String, Object> procedurePay(Long productId) {
        log.info("【微信方法】下单中，产品id:{}",productId);

        log.info("保存订单到数据库，订单id:{}", UUID.randomUUID());

        log.info("调用-微信下单接口");

        log.info("获得响应结果，返回prepayId:{}",UUID.randomUUID());

        log.info("返回给前端，prepayId");
        HashMap<String, Object> map = new HashMap<>();
        map.put("code_url","https://www.baidu.com");
        map.put("payType","支付宝支付");
        return map;
    }

    @Override
    public Map<String, Object> procedurePayNotify(HttpServletRequest request, HttpServletResponse response) {
//        log.info();
        return null;
    }
}
